package com.zyong.design.pattern.mediator.case2;

/**
 * 咖啡机
 * @program: zyong-design-pattern
 * @ClassName: CoffeeMachine
 * @author: zyong
 * @create: 2024-04-04 08:56
 */
public class CoffeeMachine extends AbstractColleague {
    public CoffeeMachine(Mediator mediator, String name) {
        super(mediator, name);
    }

    @Override
    public void sendMessage(int stateChange) {
        getMediator().getMessage(stateChange, name);
    }

    public void startCoffee() {
        System.out.println("it is time to start coffee");
    }

    public void finishCoffee() {
        System.out.println("after 5 minutes!");
        System.out.println("coffee is ok!");
        sendMessage(0);
    }
}
